package cn.iocoder.ny.module.mall.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * 商品表
 */
@Data
@TableName(value = "mall_product")
public class MallProduct {

    @TableId(value = "id", type = IdType.AUTO)
    @NotNull(message = "ID不能为null", groups = Edit.class)
    private Long id;

    /**
     * 商品分类id
     */
    @TableField(value = "category_id")
    @NotNull(message = "商品分类不能为空", groups = {Add.class,Edit.class})
    private Long categoryId;

    /**
     * banner图片地址
     */
    @TableField(value = "images")
//    @NotNull(message = "图片地址不能为空", groups = {Add.class,Edit.class})
    private Object images;

    /**
     * 商品标题
     */
    @TableField(value = "title")
    @Size(max = 255, message = "商品标题最大长度要小于255", groups = {Add.class, Edit.class})
//    @NotBlank(message = "商品标题不能为空", groups = {Add.class,Edit.class})
    private String title;

    /**
     * 商品描述
     */
    @TableField(value = "description")
//    @NotBlank(message = "商品描述不能为空", groups = {Add.class,Edit.class})
    private String description;

    /**
     * 排序
     */
    @TableField(value = "sort")
    private Integer sort;

    /**
     * 是否显示  0：false  1:true【上下架】
     */
    @TableField(value = "is_show")
    private Integer isShow;

    /**
     * 创建者
     */
    @TableField(value = "create_by")
    @Size(max = 64, message = "创建者最大长度要小于64", groups = {Add.class, Edit.class})
    private String createBy;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新者
     */
    @TableField(value = "update_by")
    @Size(max = 64, message = "更新者最大长度要小于64", groups = {Add.class, Edit.class})
    private String updateBy;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    /**
     * 备注
     */
    @TableField(value = "remark")
    @Size(max = 500, message = "备注最大长度要小于500", groups = {Add.class, Edit.class})
    private String remark;

    /**
     * 租户id
     */
    @TableField(value = "tenant_id")
//    @NotNull(message = "租户ID不能为null", groups = {Add.class, Edit.class})
    private Long tenantId;

    /**
     * 删除标记  0：false   1：true
     */
    @TableField(value = "del_flag")
    private Integer delFlag;

    /**
     * 物流方式  0:到店核销
     */
    @TableField(value = "logistics_method")
    private Integer logisticsMethod;

    /**
     * 表单模版
     */
    @TableField(value = "form_json")
    private Object formJson;

    public interface Add {}
    public interface Edit {}

}
